home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 June: Reference Library / Dev.CD Jun 96 RL / Dev.CD Jun 96 RL.toast / Technical Documentation / develop / develop Issue 26 / develop Issue 26 code / Truffles - Display Mgr. / Sprocket / Sources / UtilityClasses.cp < prev    next >
Encoding:
Text File  |  1996-01-01  |  572 b   |  35 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        UtilityClasses.cp
  3.  
  4.     Contains:    Useful utility functions when using the Drag Manager.
  5.  
  6.     Written by: Dave Falkenburg
  7.  
  8.     Copyright:    © 1993-1996 by Dave Falkenburg, all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.      
  12.  */
  13.  
  14. #include "UtilityClasses.h"
  15.  
  16.  
  17. TGraphicsContext::TGraphicsContext(GrafPtr aPort)
  18.     {
  19.     GetPort(&fOldPort);
  20.     SetPort(aPort);
  21.     
  22.     fOldClip = NewRgn();
  23.     GetClip(fOldClip);
  24.     GetPenState(&fOldPenState);
  25.     }
  26.  
  27.  
  28. TGraphicsContext::~TGraphicsContext()
  29.     {
  30.     SetClip(fOldClip);
  31.     DisposeRgn(fOldClip);
  32.     SetPenState(&fOldPenState);
  33.     SetPort(fOldPort);
  34.     }
  35.